<%@ page pageEncoding="utf-8" %>
<%
    String path = request.getContextPath();
    String CONTEXT_PATH = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="zh">
<head>
    <link rel="stylesheet" href="<%=CONTEXT_PATH%>resources/login/login.css">
    <script type="text/javascript" src="<%=CONTEXT_PATH%>resources/lib/jquery.min.js"></script>
    <script type="text/javascript" src="<%=CONTEXT_PATH%>resources/common/common.js"></script>
    <script type="text/javascript" src="<%=CONTEXT_PATH%>resources/login/login.js"></script>
    <title>用户登录</title>
</head>
<body>
<div class="div_top_1">


</div>
<div class="main">
    <div class="login">
        <div class="div_top_2">

        </div>
        <div class="div_login_head">
            用户登录
        </div>

        <div class="div_empty">
        </div>
        <form action="login" method="post">
            <div class="div_input_account">
                <input class="input_account needCheck" msg="用户名" type="text" id="yhid" name="yhid" placeholder="用户名"
                       value=""/>
                <label><input type="checkbox" id="rememberYhid" name="rememberYhid" value="1">保存用户</label>
            </div>
            <div class="div_empty">
            </div>


            <div class="div_input_pwd">
                <input class="input_pwd needCheck" msg="密码" type="password" id="yhkl" name="yhkl" placeholder="密码"
                       value=""/>
                <label><input type="checkbox" id="rememberYhkl" name="rememberYhkl" value="1">保存口令</label>
            </div>
            <div class="div_empty">
            </div>
            <div class="div_error">
                <span class="span_error" id="errorInfo"></span>
            </div>
            <div class="div_button_login">
                <input id="doLogin" class="button_login" type="button" value="登录"/>
                <input class="button_reset" type="reset" value="重置"/>
            </div>
        </form>
    </div>


</div>

</body>
<script type="application/javascript">
    $(document).ready(function () {
        if (getCookie("rememberYhid") === '' && getCookie("rememberYhkl") === '') {
            $('input[type=checkbox]').prop('checked', true);
        } else {
            $('input[type=checkbox]').each(function () {
                var name = $(this).attr('name');
                $(this).prop('checked', getCookie(name) === "1");
            })
        }
    })
</script>
</html>